<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>stroke-animation</title>

    <style>
      svg circle:nth-child(1) {
        stroke-dashoffset: 0;
        transition: all 2s;
        stroke-dasharray: 314, 314;
        stroke-dashoffset: 314;
      }
      svg:hover circle:nth-child(1) {
        stroke-dashoffset: 0;
      }
    </style>
  </head>
  <body>
    <svg width="200" height="200" viewBox="0 0 200 200">
      <circle
        id="circle"
        cx="100"
        cy="80"
        r="50"
        fill="gray"
        stroke-width="5"
        stroke="green"
      />
    </svg>
  </body>
</html>
